<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%--
The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library... action
on Libraries node in Projects view can be used to add the JSTL 1.1 library.
--%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
--%>
<%
if(session.getAttribute("un")==null){
    response.sendRedirect("indexAdmin.jsp?page=Admin&url=Login");
    out.println("You must be login..!");
}else{%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<script language="javascript" type="text/javascript" src="../script/validate.js"></script>
<script language="javascript">
    function kiemtra(){
        var username = document.form1.txtusername;
        var passwordold = document.form1.txtpassold;
        var passwordnew = document.form1.txtpassnew;
        var passwordconfig = document.form1.txtpasscofig;
        if( laChuoiRong(username.value))
	{
            alert('username is not blank!');
            username.focus();
            return false;
	}
        if( laChuoiRong(passwordold.value))
	{
            alert('Password old is not blank!');
            passwordold.focus();
            return false;
	}
        if( laChuoiRong(passwordnew.value))
	{
            alert('Password new is not blank!');
            passwordnew.focus();
            return false;
	}
        if( laChuoiRong(passwordconfig.value))
	{
            alert('Confirm password is not blank!');
            passwordconfig.focus();
            return false;
	}
        if(passwordnew.value.length<6)
        {
            alert('Password must be 6 characters or more!');
            passwordnew.focus();
            return false;
	}
        if(passwordnew.value!=passwordconfig.value)
	{
            alert('Comfirm password invalid!');
            passwordconfig.focus();
            return false;
	}
    }
</script>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        
    <form action="../ControllChangePassoword" name="form1" method="post" onsubmit="return kiemtra()" >
            <table>
                <tr align="center">
                    <td ></td>
                    <td colspan="2"><h4>Change Password</h4></td>
                </tr>
                <tr>
                    <td>User name: </td>
                    <td><input type="text" name="txtusername" value="" /></td>
                </tr>
                <tr>
                    <td>Password old: </td>
                    <td><input type="password" name="txtpassold" value="" /></td>
                </tr>
                <tr>
                    <td>Password New: </td>
                    <td><input type="password" name="txtpassnew" value="" /></td>
                </tr>
                <tr>
                    <td>Confirm Password: </td>
                    <td><input type="password" name="txtpasscofig" value="" /></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input type="submit" name="btchange" value="Submit" /></td>
                </tr>
            </table>
        </form>
    
    </body>
</html>
<%}%>